# 字符串
str = "py的字符串类型"
print("=================================")
print(str[1:])
print(str[2:5])
print(str * 2)
# list集合
list = ['runoob', 786, 2.23, 'john', 70.2]
tinylist = [123, 'john']
print("=================================")
print(list[1])
print(list[1:])
print(list * 2)
print(list + tinylist)
# 元组
tuple = ('runoob', 786, 2.23, 'john', 70.2)
tinytuple = (123, 'john')
print("=================================")
print(tuple)  # 输出完整元组
print(tuple[0])  # 输出元组的第一个元素
print(tuple[1:3])  # 输出第二个至第三个的元素
print(tuple[2:])  # 输出从第三个开始至列表末尾的所有元素
print(tinytuple * 2)  # 输出元组两次
print(tuple + tinytuple)  # 打印组合的元组

# 字典数据类型
dict = {}
dict['one'] = "This is one"
dict[2] = "This is two"
print("=================================")
print(dict["one"])
print(dict[2])
print(dict)
print(dict.keys())
print(dict.values())

# set集合
basket = {"aa", "vv", "cc"}
print("=================================")
print(basket)
print("aa" in basket)

for a in basket:
    print(a)

a = set('abracadabra')
b = set('alacazam')

print(a)
print(b)
# 集合a中包含元素
print(a - b)
#集合a或b中包含的所有元素
print(a | b)
#集合a和b中都包含了的元素
print(a & b)
#不同时包含于a和b的元素
print(a^b)
